<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>已发布的委托</title>
  <link rel="stylesheet" th:href="@{/layui-v2.6.4/layui/css/layui.css}" type="text/css"/>
  <link rel="stylesheet" th:href="@{/layui-v2.6.4/layui/css/modules/code.css}" type="text/css"/>
  <script th:src="@{/js/jquery-3.5.1.min.js}"></script>
  <script charset="utf-8" th:src="@{/layui-v2.6.4/layui/layui.js}" type="text/javascript"></script>
  <script>
    layui.use('element', function () {
      var element = layui.element;
    });
  </script>
  <style>
    body {
      height: 100%;
/*
      background: linear-gradient(90deg, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB);
*/
    }
  </style>
</head>
<body>
<div class="layui-fluid" >
  <div class="layui-row">
<div class="layui-col-md12 layui-tab">

  <table class="layui-table">
    <thead>
    <tr >
      <th >Id</th>
      <th >委托内容</th>
      <th >悬赏金额</th>
      <th >接单状态</th>
      <th>接单人</th>
      <th >接单人电话</th>
      <th >结束时间</th>
      <th >操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:if="${AlreadyLeisureEntrustsByEntId.size() eq 0}" style="width: 100%;height: 40px;text-align: center;margin: auto">
      <td  colspan="8" style="width: 100%;height: 100%;">目前没有提交的单</td>
    </tr>
    <tr th:each="entrust : ${AlreadyLeisureEntrustsByEntId}">
      <td th:text="${entrust.entrustId}"></td>
      <td th:text="${entrust.getEntData()}"></td>
      <td th:text="${entrust.getEntMoney()}"></td>
      <td th:text="${entrust.getEntPlan()}"></td>
      <td th:text="${entrust.getEntAgent()}"></td>
      <td th:text="${entrust.getUserPhone()}"></td>
      <td th:text="${#dates.format(entrust.getGmtEnd(), 'yyyy-MM-dd')}"></td>
      <td><i th:onclick="rev([[${entrust.entrustId}]],[[${entrust.getEntConsignor()}]]);" >通过</i>&nbsp;&nbsp;
      </td>
    </tr>
    </tbody>
    <script>
      function rev(bbb,ddd) {
        layer.confirm('您确定要通过吗？', {
          btn: ['通过', '取消'] //按钮
        }, function () {
          $.ajax({
            url: "/tongguo"
            , type: 'get'
            , async: false
            , data: {
              id:bbb,
              useId:ddd
            }
            , success: function (str) {
              layer.msg('通过成功');
              setTimeout(function () {
                location.assign("/toJieDan/"+ddd)
              },1500);
            }
      })
      })
      }
      function del(aaa,ccc) {
        layer.confirm('您确要不通过吗？', {
          btn: ['不通过', '取消'] //按钮
        }, function () {
          $.ajax({
            url: "/weitongguo"
            , type: 'get'
            , async: false
            , data: {
              id:aaa
            }
            , success: function (str) {
              layer.msg('不通过成功');
              setTimeout(function () {
                location.assign("/toJieDan/"+ccc)
              },1500);
            }
          });
        })
      }
    </script>
  </table>

</div>
  </div>
</div>
</body>
</html>